package com.kehongborui.portal.service.impl;

import com.kehongborui.data.domain.User;
import com.kehongborui.portal.model.UserModel;
import com.kehongborui.portal.service.UserService;
import com.kehongborui.data.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author zhang peng yang ming
 * @CopyRight (C) http://www.csdn.com
 * @brief
 * @email 122162005@qq.com
 * @date 2018-09-20
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserRepository userRepository;

    @Override
    public UserModel findByUsername(String username) {
        return null;
//        return userRepository.findByUsername(username);
    }

    @Override
    public UserModel save(UserModel model) {
        User user = new User();
        user.setUsername("张三");
        user.setPassword("张三");
        User save = userRepository.save(user);
        System.out.println(save);
        return model;
    }
}
